package pers.qianyu.month_202012.date_20201203;

/**
 * @author mizzle rain
 * @date 2020-12-03 20:30
 */
public class CanJump {
    public boolean canJump(int[] nums) {
        if (nums == null || nums.length == 0) {
            return true;
        }
        int max = 0;
        for (int i = 0; i < nums.length - 1; i++) {
            max = Math.max(max, nums[i] + i);
            if (max <= i) {
                return false;
            }
        }
        return true;
    }
}
